package com.example.leetcode.graph;

import com.example.leetcode.graph.common.GraphUtils;

class Solution200 {
    public int numIslands(char[][] grid) {
        return GraphUtils.numIslands(grid);
    }
}

public class leetcode200 {
    public static void main(String[] args) {
        Solution200 solution200 = new Solution200();
        char[][] grid = {
                {'1', '1', '1', '1', '0'},
                {'1', '1', '0', '1', '0'},
                {'1', '1', '0', '0', '0'},
                {'0', '0', '0', '0', '0'}
        };
        System.out.println(solution200.numIslands(grid));

        char[][] grid1 = {
                {'1', '1', '0', '0', '0'},
                {'1', '1', '0', '0', '0'},
                {'0', '0', '1', '0', '0'},
                {'0', '0', '0', '1', '1'}
        };
        System.out.println(solution200.numIslands(grid1));
    }
}
